{% extends "../../theme/bage.html" %}
{% block typebody %}
<div class="mtop">
    <ul class="breadcrumb">
        <li>{{ _('Current location') }}: <a href="{% module site_url() %}">{{ _('Home') }}</a></li>
        <li class="active">{{ _('Entity List') }}</li>
        {% if userinfo and (userinfo.user_name=='admin' or  kwd.get('can_add',False)) %}
        <li><a href="/entry/add" class="btn btn-primary btn-xs">{{ _('Upload Files') }}</a></li>
        {% end %}
    </ul>
</div>
<div class="panel panel-black">
    <div class="panel-heading"><b>{{ _('Entity List') }}</b></div>
    <div class="panel-body">
        <table class="table table-bordered">
            <tr>
                <td>Serial number</td>
                <td>Url</td>
                <td>Desc</td>
                <td>Img</td>
            </tr>
             {% set ii = 1 %}
            {% for x in imgs %}
            <tr>
                <td>
                    {{ ii }}

                </td>
                {% if x.kind == '1' %}

                    {% if len(x.path) == 39 %}
                        <td>
                            <a href="{% module site_url() %}{{ static_url('upload/') }}{{ x.path }}_m.jpg"
                               target="_blank" title="{% module site_url() %}{{ static_url('upload/') }}{{ x.path }}_m.jpg">
                                {% module site_url() %}{{ static_url('upload/') }}{{ x.path}}_m.jpg
                            </a>
                        </td>
                        <td>
                            {{ x.desc }}
                        </td>
                        <td>
                            <a href="{{ static_url('upload/') }}{{ x.path }}_m.jpg" target="_blank"
                               title="{{ static_url('upload/') }}{{ x.path }}_m.jpg">
                                <img src="{{ static_url('upload/') }}{{ x.path }}_m.jpg" style="width: 150px" alt="{{ x.path}}"/>
                            </a>
                        </td>
                    {% else %}
                        <td>
                            <a href="{% module site_url() %}{{ static_url('upload/') }}{{ x.path }}"
                               title="{% module site_url() %}{{ static_url('upload/') }}{{ x.path }}"
                               target="_blank">
                                {% module site_url() %}{{ static_url('upload/') }}{{ x.path }}
                            </a>
                        </td>
                        <td>
                            {{ x.desc }}
                        </td>
                        <td>
                            <a href="{{ static_url('upload/') }}{{ x.path }}" target="_blank"
                               title="{{ static_url('upload/') }}{{ x.path }}">
                                <img src="{{ static_url('upload/') }}{{ x.path }}" style="width: 150px" alt="{{ x.path}}"/>
                            </a>
                        </td>
                    {% end %}

                {% else %}

                <td>
                    {% if x.path.startswith('http://') or x.path.startswith('https://')%}

                    <a href="{{x.path}}" target="_blank" title="{{x.path}}">

                        {{x.path}}
                    </a>
                    {% elif x.path.startswith('/static/')%}
                        <a href="{% module site_url() %}{{x.path}}" target="_blank"
                       title="{% module site_url() %}{{x.path}}">
                        {% module site_url() %}{{x.path}}
                        </a>
                    {% elif x.kind=='f' %}
                    <a href="{% module site_url() %}{{ static_url('') }}{{x.path}}" target="_blank"
                       title="{% module site_url() %}{{ static_url('') }}{{x.path}}">
                        {% module site_url() %}{{ static_url('') }}{{x.path}}
                        </a>
                    {% else %}
                    <a href="{% module site_url() %}{{ static_url('upload/') }}{{x.path}}" target="_blank"
                       title="{% module site_url() %}{{ static_url('upload/') }}{{x.path}}">
                        {% module site_url() %}{{ static_url('upload/') }}{{x.path}}
                    </a>
                    {% end %}
                </td>
                <td>
                     {{ x.desc }}
                </td>
                 <td></td>
                {% end %}

            </tr>
            {% set ii = ii +1 %}
            {% end %}
        </table>
        {% module entity_pager( kwd['current_page'] ) %}
        <br>
    </div>
</div>


{% end %}

